
**TABLE 3 : Business Outcomes**

*Columns (1) - (3)
	*(1) = Business Knowledge
	*(2) = New Business CO member involved
	*(3) = New Business CO member NOT involved

use "$data\followup_only", clear

********
*Initial cleaning steps
*Generate various dummy and interaction variables:
	gen A_EDT_elig= (A_EDT==1 & d_lleligible==1)
	gen A_EDT_no_elig= (A_EDT==1 & d_lleligible==0)
	gen nobt_ne_nolw = EDT_treat==0 & d_lleligible==0 & L_ttreat==0
	gen noelig_nolw= (B_LL==0 & d_lleligible==0)
	gen A_EDT_elig_fem=A_EDT_elig*female
	gen A_EDT_no_elig_fem=A_EDT_no_elig*female
	gen nobt_ne_nolw_fem = nobt_ne_nolw*female
	gen noelig_nolw_fem=noelig_nolw*female

********
*Panel A - Without female interactions
	local xvars "EDT_treat female d_lleligible bl_bus_owner fu_dummy*"
	local yvars "bus_literacy_aggregate2 mem_new_bus HH_new_bus " 
	
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if ( fu_dummy7==0  & post==1 ), cl(co_code1)
		estimates store `y'
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3A-col1-3.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq")) replace
	estimates clear

********
*Panel B - BT*female interactions
	local xvars "EDT_treat EDT_female female d_lleligible bl_bus_owner fu_dummy*"
	local yvars "bus_literacy_aggregate2 mem_new_bus HH_new_bus " 
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if ( fu_dummy7==0  & post==1 ), cl(co_code1)
		estimates store `y'
		test EDT_treat + EDT_female =0
		estadd scalar p_diff1 = r(p)
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & female==0)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3B-col1-3.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1, fmt(2 0 2 2 2 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1")) replace
	estimates clear

********
*Panel C - Including various treatment groups
	*Dummy for Business Training (BT): no BT is comparison group
	*Dummy for Eligibility (E): E is comparison group
	*Dummy to Lottery Winner (LW): not a LW is the comparison group

	local xvars "A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw female bl_bus_owner fu_dummy*"
	local yvars "bus_literacy_aggregate2 mem_new_bus HH_new_bus " 
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if ( fu_dummy7==0  & post==1 ), cl(co_code1)
		estimates store `y'
		test A_EDT_elig =B_LL
		estadd scalar p_diff1 = r(p)
		test A_EDT_elig =C_EDT_LL
		estadd scalar p_diff2 = r(p)
		test C_EDT_LL =B_LL
		estadd scalar p_diff3 = r(p)
		test A_EDT_no_elig =nobt_ne_nolw
		estadd scalar p_diff4 = r(p)
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & L_ttreat ==0 & d_lleligible==1)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3C-col1-3.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw) starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1 p_diff2 p_diff3 p_diff4, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4")) replace
	estimates clear

********
*Panel D - Including treatment groups + Gender interactions
	local xvars "A_EDT_elig A_EDT_elig_fem A_EDT_no_elig A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female bl_bus_owner fu_dummy*"
	local yvars "bus_literacy_aggregate2 mem_new_bus HH_new_bus " 
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if ( fu_dummy7==0  & post==1 ), cl(co_code1)
		estimates store `y'
		test A_EDT_elig =B_LL
		estadd scalar p_diff1 = r(p)
		test A_EDT_elig =C_EDT_LL
		estadd scalar p_diff2 = r(p)
		test C_EDT_LL =B_LL
		estadd scalar p_diff3 = r(p)
		test A_EDT_no_elig =nobt_ne_nolw
		estadd scalar p_diff4 = r(p)
		test A_EDT_elig + A_EDT_elig_fem=0
		estadd scalar p_diff5 = r(p)
		test A_EDT_no_elig + A_EDT_no_elig_fem=0
		estadd scalar p_diff6 = r(p)
		test B_LL +B_female =0
		estadd scalar p_diff7 = r(p)
		test C_EDT_LL +C_female =0
		estadd scalar p_diff8 = r(p)
		test nobt_ne_nolw + nobt_ne_nolw_fem=0
		estadd scalar p_diff9= r(p)
		sum `y' if (fu_dummy7==0 & post==1 & EDT_treat==0 & L_ttreat ==0 & d_lleligible==1 & female==0)
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3D-col1-3.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig  A_EDT_elig_fem A_EDT_no_elig A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1 p_diff2 p_diff3 p_diff4 p_diff5 p_diff6 p_diff7 p_diff8 p_diff9 , fmt(2 0 2 2 2 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4" "p5" "p6" "p7" "p8" "p9")) replace
	estimates clear


**FAILED BUSINESSES**

*Column (4) = Main business failed

********
*Panel A - Without female interactions
	reg failed_mainbus EDT_treat female d_lleligible fu_dummy* ///
		if post==1 & fu_dummy7==0 & bl_bus_owner==1 , cl(co_code1)
	estimates store failed_mainbus

	sum failed_mainbus if post==1 & fu_dummy7==0 & bl_bus_owner==1 & EDT_treat==0
	estadd scalar mean_y=r(mean)
	estout * using "$out/Table3A-col4.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq")) replace
	estimates clear

********
*Panel B - BT*female interactions
	reg failed_mainbus EDT_treat EDT_female female d_lleligible fu_dummy* ///
		 if post==1 & fu_dummy7==0 & bl_bus_owner==1 , cl(co_code1)
	estimates store failed_mainbus

	test EDT_treat + EDT_female =0
	estadd scalar p_diff1 = r(p)
	
	sum failed_mainbus if post==1 & fu_dummy7==0 & bl_bus_owner==1 & EDT_treat==0 & female==0
	estadd scalar mean_y=r(mean)
	estout * using "$out/Table3B-col4.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1, fmt(2 0 2 2) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1")) replace
	estimates clear

********
*Panel C - Including various treatment groups
	reg failed_mainbus A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw ///
		female fu_dummy* if post==1 & fu_dummy7==0 & bl_bus_owner==1 , cl(co_code1)
	estimates store failed_mainbus
	
	test A_EDT_elig =B_LL
	estadd scalar p_diff1 = r(p)	
	test A_EDT_elig =C_EDT_LL
	estadd scalar p_diff2 = r(p)
	test C_EDT_LL =B_LL
	estadd scalar p_diff3 = r(p)
	test A_EDT_no_elig =nobt_ne_nolw
	estadd scalar p_diff4 = r(p)
	
	sum failed_mainbus if post==1 & fu_dummy7==0 & bl_bus_owner==1 & EDT_treat==0 & L_ttreat ==0 & d_lleligible==1
	estadd scalar mean_y=r(mean)
	estout * using "$out/Table3C-col4.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep( A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw) starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1 p_diff2 p_diff3 p_diff4, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4")) replace
	estimates clear

********
*Panel D - Including treatment groups + Gender interactions
	reg failed_mainbus  A_EDT_elig  A_EDT_elig_fem A_EDT_no_elig A_EDT_no_elig_fem ///
		B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female ///
		fu_dummy* if post==1 & fu_dummy7==0 & bl_bus_owner==1 , cl(co_code1)
	estimates store failed_mainbus
	
	test A_EDT_elig =B_LL
	estadd scalar p_diff1 = r(p)
	test A_EDT_elig =C_EDT_LL
	estadd scalar p_diff2 = r(p)
	test C_EDT_LL =B_LL
	estadd scalar p_diff3 = r(p)
	test A_EDT_no_elig =nobt_ne_nolw
	estadd scalar p_diff4 = r(p)
	test A_EDT_elig + A_EDT_elig_fem=0
	estadd scalar p_diff5 = r(p)
	test A_EDT_no_elig + A_EDT_no_elig_fem=0
	estadd scalar p_diff6 = r(p)
	test B_LL +B_female =0
	estadd scalar p_diff7 = r(p)
	test C_EDT_LL +C_female =0
	estadd scalar p_diff8 = r(p)
	test nobt_ne_nolw + nobt_ne_nolw_fem=0
	estadd scalar p_diff9= r(p)
	
	sum failed_mainbus if post==1 & fu_dummy7==0 & bl_bus_owner==1 & EDT_treat==0 & L_ttreat ==0 & d_lleligible==1 & female==0
	estadd scalar mean_y=r(mean)
	estout * using "$out/Table3D-col4.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig A_EDT_no_elig A_EDT_elig_fem A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1 p_diff2 p_diff3 p_diff4 p_diff5 p_diff6 p_diff7 p_diff8 p_diff9, fmt(2 0 2 2 2 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4" "p5" "p6" "p7" "p8" "p9")) replace
	estimates clear


**BUSINESS AGGREGATES**

*Columns (5) - (7)
	*(5) = Aggregate business practices
	*(6) = Aggregate business operations
	*(7) = Aggregate business sales and profits

use "$data/business_visit.dta", clear
replace female=0 if female==. & post==1 & bus_basline==1

********
*Generate various dummy and interaction variables:
	gen A_EDT_elig = (A_EDT==1 & d_lleligible==1)
	gen A_EDT_no_elig = (A_EDT==1 & d_lleligible==0)
	gen nobt_ne_nolw = EDT_treat==0 & d_lleligible==0 & L_ttreat==0
	gen noelig_nolw = (B_LL==0 & d_lleligible==0)

	gen A_EDT_elig_fem=A_EDT_elig*female
	gen A_EDT_no_elig_fem=A_EDT_no_elig*female
	gen nobt_ne_nolw_fem = nobt_ne_nolw*female
	gen EDT_female=EDT_treat*female
	

********
*Panel A - Without female interactions
	local xvars "EDT_treat female d_lleligible  fudummy*"
	local yvars "global_practice_outcomes global_operation_outcomes2 global_monetary_outcomes "
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if (post==1 & bus_basline==1) , cl(co_code)
		estimates store `y'
		sum `y' if (post==1 & bus_basline==1 &  EDT_treat==0) 
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3A-col5-7.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2, fmt(2 0 2) ///
		labels("mean dependent variable" "N.obs" "R-Sq")) replace
	estimates clear

********
*Panel C - Including various treatment groups
	local xvars "A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw female bl_bus_owner fudummy*"
	local yvars "global_practice_outcomes global_operation_outcomes2 global_monetary_outcomes "
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if (post==1 & bus_basline==1) , cl(co_code)
		estimates store `y'
		test A_EDT_elig =B_LL
		estadd scalar p_diff1 = r(p)
		test A_EDT_elig =C_EDT_LL
		estadd scalar p_diff2 = r(p)		
		test C_EDT_LL =B_LL
		estadd scalar p_diff3 = r(p)
		test A_EDT_no_elig =nobt_ne_nolw
		estadd scalar p_diff4 = r(p)
		sum `y' if (post==1 & bus_basline==1 &  EDT_treat==0 & L_ttreat ==0 & d_lleligible==1) 
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3C-col5-7.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig A_EDT_no_elig B_LL C_EDT_LL nobt_ne_nolw) starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1 p_diff2 p_diff3 p_diff4, fmt(2 0 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4")) replace
	estimates clear

********
*Panel B - BT*female interactions
	drop B_female C_female
	gen B_female= B_LL*female
	gen C_female= C_EDT_LL*female
	gen noelig_nolw_fem=noelig_nolw*female

	local xvars "EDT_treat EDT_female  female d_lleligible  fudummy*"	
	local yvars "global_practice_outcomes global_operation_outcomes2 global_monetary_outcomes "
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if (post==1 & bus_basline==1) , cl(co_code)
		estimates store `y'
		test EDT_treat + EDT_female = 0
		estadd scalar p_diff1 = r(p)
		sum `y' if (post==1 & bus_basline==1 &  EDT_treat==0 & female==0) /* XG: NEED MEAN DEP VAR OF CONTROLS, NOT THE VAR IN GENERAL */
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3B-col5-7.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1, fmt(2 0 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1")) replace
	estimates clear

********
*Panel D - Including treatment + Gender interactions

*Generate various dummy and interaction variables:
	local xvars "A_EDT_elig A_EDT_elig_fem A_EDT_no_elig A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female bl_bus_owner fudummy* " 
	local yvars "global_practice_outcomes global_operation_outcomes2 global_monetary_outcomes "
	est clear
	local j =1
	foreach y in `yvars' {
		reg `y' `xvars' if (post==1 & bus_basline==1) , cl(co_code)
		estimates store `y'
		test A_EDT_elig =B_LL
		estadd scalar p_diff1 = r(p)
		test A_EDT_elig =C_EDT_LL
		estadd scalar p_diff2 = r(p)
		test C_EDT_LL =B_LL
		estadd scalar p_diff3 = r(p)
		test A_EDT_no_elig =nobt_ne_nolw
		estadd scalar p_diff4 = r(p)
		test A_EDT_elig + A_EDT_elig_fem=0
		estadd scalar p_diff5 = r(p)		
		test A_EDT_no_elig + A_EDT_no_elig_fem=0
		estadd scalar p_diff6 = r(p)
		test B_LL +B_female =0
		estadd scalar p_diff7 = r(p)
		test C_EDT_LL +C_female =0
		estadd scalar p_diff8 = r(p)
		test nobt_ne_nolw + nobt_ne_nolw_fem=0
		estadd scalar p_diff9= r(p)
		sum `y' if (post==1 & bus_basline==1 &  EDT_treat==0 & L_ttreat ==0 & d_lleligible==1 & female==0) 
		estadd scalar mean_y=r(mean)
		local j = `j'+1
	}
	estout * using "$out/Table3D-col5-7.xls", cells("b(star fmt(3))" se(par(`"="("' `")""'))) ///
		keep(A_EDT_elig  A_EDT_elig_fem A_EDT_no_elig A_EDT_no_elig_fem B_LL B_female C_EDT_LL C_female nobt_ne_nolw nobt_ne_nolw_fem female) ///
		starlevels(* 0.10 ** 0.05 *** 0.01) ///
		stats(mean_y N r2 p_diff1 p_diff2 p_diff3 p_diff4 p_diff5 p_diff6 p_diff7 p_diff8 p_diff9, fmt(2 0 2 2 2 2 2 2 2 ) ///
		labels("mean dependent variable" "N.obs" "R-Sq" "p1" "p2" "p3" "p4" "p5" "p6" "p7" "p8" "p9")) replace
	estimates clear

